Skip to content

test(mimo): skip native-lane tests on machines without the lane - #192

Merged
Gajesh2007 merged 2 commits into
mainfrom
test/gate-native-lane-tests
Oct 2, 2026
Merged

Gajesh2007 merged 2 commits into
mainfrom
test/gate-native-lane-tests

Conversation

@davidtai

@davidtai davidtai commented Sep 30, 2026 •

Copy link
Copy Markdown

Proposed changes

Since main commit eeba2af (#178, the MiMo merge), every run of Fork Tests on main fails. The whole-package pass reports 37 XCTest failures. Run 36680221760 on main d83912f lists them. The run before #178 (run 36618524832 on ef3bdaa) has no nativeLaneRequired error.

31 of the 37 fail with failed: caught error: "nativeLaneRequired". Main commit 0871943 (#205) then added three tests to the same suites with the same error (run 36769006274). This PR merges that main commit, so the gate covers 34 tests. Each of these tests calls a fixture() helper, or its own guard, that throws when the MIMO_V26_* environment variables of the exclusive native GPU lane are not set. The hosted macos-26 runner does not set them, so the tests fail instead of skipping.

This PR turns each of those throws into XCTSkipUnless on the same environment variables. The tests now skip on a machine without the lane, with a message that names the variables. They run as before where the variables are set. The other MiMo suites (for example MiMoV26FactoryTests, MiMoV26VisionTests) already skip this way. The unused nativeLaneRequired enum case is removed from each suite.

Tests only. No production code change. The tests are XCTest, so the .referenceHardware trait of #174 does not apply.

Gating condition

Suite Variables that must be 1
MiMoV26NativeMediaDeadlineTests MIMO_V26_SERIAL_NATIVE_TESTS, MIMO_V26_NATIVE_MEDIA_DEADLINE_TESTS
MiMoV26ManagedDecodedAudioTests MIMO_V26_SERIAL_NATIVE_TESTS, MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS; the three testInnerRequired* fault tests also need MIMO_V26_MANAGED_AUDIO_FAULT_TEST
MiMoV26RectangularVerifyNativeTests MIMO_V26_SERIAL_NATIVE_TESTS, MIMO_V26_RECTANGULAR_NATIVE_TESTS
MiMoV26ManagedCompletePrefixTests MIMO_V26_SERIAL_NATIVE_TESTS, MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS
MiMoV26ManagedAudiovisualTests MIMO_V26_SERIAL_NATIVE_TESTS, MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS, MIMO_V26_DECODED_AV_NATIVE_TESTS

The three testInnerRequired* fault tests share one helper, assertRequiredInnerFailure, which holds the gate. They also skip in a release build, because the fault hook exists only in debug builds. Before, it threw nativeLaneRequired there too.

Gated tests (34)

Every test below shows nativeLaneRequired in the log of run 36680221760, or of run 36769006274 for the three marked (#205).

MiMoV26NativeMediaDeadlineTests (11):

  • testCancellationAfterCommitTransfersRealMediaRetirement
  • testCancellationBeforeAtomicCommitDoesNotBindFeaturesOrStrandLoan
  • testElapsedQueueWaitDoesNotResetAbsoluteDeadline
  • testExpiredAndMissingRateKeepSealUnboundForRetryOrDiscard
  • testGenerationChangeWhileQueuedIsRevalidatedWithoutConsumption
  • testLateShutdownAndExplicitDiscardLeaveNoBoundSealForColdRefusal
  • testMaxWaitingCapacityRefusalLeavesPreparedSealDiscardable
  • testMediaReservationRefusalLeavesTextEngineUsable (Fix MiMo media memory reservations with bounded native execution #205)
  • testPreparedImageUsesBoundedRealProjectionAndMatchesOrdinaryGreedyTokens
  • testRawAndForeignSealsRefuseAndPlainTextDeadlineRemainsBounded
  • testUntrackedRawCausalMediaStillReturnsUnboundedWithoutCallingProvider

MiMoV26ManagedDecodedAudioTests (12):

  • testActualInstalledTextMTPRemainsActiveAfterTargetOnlyAudio
  • testActualSidecarInvalidationAtBindingRefusesWhenBareCodecStillValid
  • testAudioLoanPrecedesCodecAndSuccessfullyDrainedCancellationKeepsEngineHealthy
  • testForeignActualEngineCannotBorrowTheLoadedAudioProfile
  • testInnerRequiredCodesReadbackFailureRetainsOriginalInnerRootsBeforeCleanup
  • testInnerRequiredEncoderCheckpointFailureRetainsOriginalRoots (Fix MiMo media memory reservations with bounded native execution #205)
  • testInnerRequiredQuantizerCheckpointFailureRetainsOriginalRoots (Fix MiMo media memory reservations with bounded native execution #205)
  • testRealPCMAndOrderedMixedPreparationSubmitRetireThenTextOnSameEngine
  • testRequiredPreparationFenceFailureRetainsAudioOwnerAndBothObligations
  • testSeparateSidecarReservationRevocationRefusesBeforeWarmWorkAndAtActualBind
  • testSupportedLoadedGenerationInvalidationRejectsAlreadyPreparedAudio
  • testTextAndVisualProfilesDoNotGainAudioFromInstalledSidecar

MiMoV26RectangularVerifyNativeTests (5):

  • testActualAudioProfileKeepsPCMTargetOnlyThenTextCanVerify
  • testCancelAfterEvaluatedVerifyRetainsRootsUntilDrainAndAllowsIDReuse
  • testCandidateSamplerFallbacksAndColdCancellationDoNotDraft
  • testTrackedOFFSerialRectangularTokensAndCompletedWindowEngagement
  • testVisualProfileRetainsMediaAndMixedTextRectangularVerification

MiMoV26ManagedCompletePrefixTests (3):

  • testAlreadyIssuedJointProfileRejectsMetadataAndSeparateProfileUpgrade
  • testJointAudioAndThreeHeadMTPKeepTextReuseAfterRealMixedPCM
  • testJointVisualKeepsActualTextReuseAndNoncacheableImageOnSameEngine

MiMoV26ManagedAudiovisualTests (3):

  • testDecodedAVTargetOnlyThenActualTextMTPOnSameEngine
  • testVisualProfileAndEmptyNativeUnitRefuseBeforeAdmissionThenHealthyAVWorks
  • testWholeEncodeOnceExactFeatureSlicesInterleaveFullBackingPriceAndRealRetirement

Not gated

The other 6 of the 37 failures do not show nativeLaneRequired. They fail for other reasons and are not changed by this PR:

Test Error in run 36680221760
CBv2PagedAttentionWorkReservationTests.testCoexistingGenerationsHaveIndependentChargesUntilBothComplete backendIneligible(reason: "step-owned paging has no valid engine/process/stream preparation")
CBv2PagedAttentionWorkReservationTests.testLocalAndProcessTightCapsRefuseBeforeAnyCursorPageOrFenceMutation capacityExhausted(needed: 747778, available: 747777)
CBv2PagedAttentionWorkReservationTests.testPackedRowsWithDifferentActualRangesStayIndependent backendIneligible(reason: "retained paged producer root is not a bounded compact destination")
CBv2PagedAttentionWorkReservationTests.testSameGeometryWrongBorrowerOwnerRefusesBeforeReadingOrChangingFence backendIneligible(reason: "paged work row/cache identity, generation or frozen range mismatch")
MiMoV26CBv2Tests.testNativeContiguousAdapter cache capability widened, intermediate constructed vocabulary logits
MiMoV26MTPEngineTests.testRequestIsolationMeasuredOwnershipAndRelease XCTAssertFalse failed at MiMoV26MTPEngineTests.swift:345

The 7 DiffusionGemma bit-exact tests are covered by #174. CBv2SchedulerLoopTests is covered by #191.

Dedicated CI steps

scripts/run-nested-suite.sh fails a step when a suite skips a test. None of the five gated suites runs in a dedicated step of .github/workflows/fork-tests.yml. They run only in the whole-package pass ("Run all test suites once"), which allows skips. The d-inference CI runs no MiMo suite through the script. So no workflow change is needed.

Test plan

  • swift format format --in-place --configuration .swift-format on the five changed files: no change.
  • scripts/check_forkdiff.py --upstream-ref refs/remotes/upstream/main: passes. fork.yaml already describes Tests/MLXLMTests/MiMo/**.
  • Fork Tests on the head of this PR: see the comment below with the run id, the skip count of the whole-package pass, and the tests that still fail.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes: every changed Swift file is formatted with swift format format --configuration .swift-format
  • I have added tests that prove my fix is effective or that my feature works: not applicable, this PR changes when tests run; the Fork Tests run shows the skips
  • I have updated the necessary documentation (if needed): not needed, the variables already exist and the other MiMo suites already skip on them

Dependencies

None. Based on main at d83912f, with main at 0871943 (#205) merged in.

Authorship

The commit was written by Claude Fable 5.1.

🤖 Generated with Claude Code

Since eeba2af (#178), 31 XCTest cases in five MiMo suites throw
nativeLaneRequired on the hosted CI runner, so every run of Fork Tests
on main fails. The tests need the exclusive native GPU lane, which the
runner does not have.

This change turns each of those throws into an XCTSkipUnless on the
same environment variables. The tests now skip, with the reason, on a
machine without the lane, and run as before where the variables are
set. The unused nativeLaneRequired enum case is removed from each
suite.

Tests only. No production code change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@davidtai

Copy link
Copy Markdown
Author

Fork Tests on head 79fd164: run 36741368847. Result: failure, from tests that other PRs cover. Every dedicated suite step passed, including Run CBv2SchedulerLoopTests.

Whole-package pass ("Run all test suites once"):

  • XCTest: Executed 1559 tests, with 323 tests skipped and 9 failures (6 unexpected). On main d83912f (run 36680221760) it was 292 skipped and 40 failures (37 unexpected). The difference is the 31 gated tests: each now reports Test skipped - Requires the exclusive native GPU lane. Set .... The log has no nativeLaneRequired line.
  • The 6 unexpected XCTest failures are the same 6 tests that fail for other reasons on main (4 in CBv2PagedAttentionWorkReservationTests, MiMoV26CBv2Tests.testNativeContiguousAdapter, MiMoV26MTPEngineTests.testRequestIsolationMeasuredOwnershipAndRelease). See "Not gated" above. The 3 expected failures are the same as on main.
  • Swift Testing: 1406 tests in 224 suites failed with 112 issues, all in the 9 DiffusionGemma bit-exact tests that test: run bit-exact reference tests only on reference hardware #174 gates. No other Swift Testing test recorded an issue.

@davidtai

Copy link
Copy Markdown
Author

Main commit 0871943 (#205) added three tests to the gated suites that fail the same way (run 36769006274: 34 failing native-lane tests, all nativeLaneRequired). The merge commit 2f9bd64 brings in main. No new edit was needed: the two new testInnerRequired* tests call the gated assertRequiredInnerFailure helper, and testMediaReservationRefusalLeavesTextEngineUsable calls the gated fixture(). The PR body now lists 34 gated tests.

Fork Tests on head 2f9bd64: run 36784851256. Result: failure, from tests that other PRs cover. Every dedicated suite step passed.

Whole-package pass:

  • XCTest: Executed 1573 tests, with 328 tests skipped and 9 failures (6 unexpected). Main 0871943 had 294 skipped and 43 failures (40 unexpected). The difference is the 34 gated tests, each reported as skipped with the reason. The log has no nativeLaneRequired line, and no test in the native-lane suites failed.
  • The 6 unexpected XCTest failures are the same 6 tests as on main that fail for other reasons (see "Not gated" above).
  • Swift Testing: 112 issues, all in the 9 DiffusionGemma bit-exact tests that test: run bit-exact reference tests only on reference hardware #174 gates.

@Gajesh2007
Gajesh2007 merged commit c288f53 into main Oct 2, 2026
5 of 6 checks passed
@davidtai
davidtai deleted the test/gate-native-lane-tests branch October 4, 2026 21:58
Gajesh2007 added a commit that referenced this pull request Oct 4, 2026
#289)

* fix(cache): preserve demanded fork checkpoints and bound short capture

* test: let expected paged work refusals reach the caller (#209)

PagedWorkFixture.prepare wrapped prepareAttentionWork in XCTUnwrap.
XCTUnwrap records a test failure when its expression throws, also
when the caller expects the throw with XCTAssertThrowsError. Three
tests expect prepare to refuse, so each expected refusal was recorded
as a failure. prepare now throws the refusal to the caller and fails
only when prepareAttentionWork returns nil.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b7bbdc2)

* fix(paged): write a full destination for broadcast direct KV (#210)

Materialize broadcast retained KV into a complete contiguous destination while preserving bit values, ownership validation, and reservation bounds. Focused differential paging, lifetime, and bit-exact validation completed during review.

(cherry picked from commit 3799b11)

* test(mimo): skip native-lane tests on machines without the lane (#192)

Since eeba2af (#178), 31 XCTest cases in five MiMo suites throw
nativeLaneRequired on the hosted CI runner, so every run of Fork Tests
on main fails. The tests need the exclusive native GPU lane, which the
runner does not have.

This change turns each of those throws into an XCTSkipUnless on the
same environment variables. The tests now skip, with the reason, on a
machine without the lane, and run as before where the variables are
set. The unused nativeLaneRequired enum case is removed from each
suite.

Tests only. No production code change.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit c288f53)

* test(mimo): assert the MiMo contracts that #171 shipped (#211)

Three assertions in the MiMo tests disagree with the code that the same
PR (#171) added:

- The MiMo cache conforms to CBv2MTPRectangularSerializing, and
  MiMoV26RectangularVerifyTests asserts that the bank supports
  rectangular MTP verification. The test asserted the opposite.
- CBv2PrefillRequirement.evaluationOnly returns a [B, 1] handle
  (EngineLoopV2.prefillOutput). The test expected shape [1].
- MiMoV26MTPAssistant conforms to
  CBv2HistoricalMTPPrefixCheckpointCoding (MiMoV26MTPPrefixCheckpoint).
  The test asserted that it is not a prefix checkpoint drafter.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5e9d268)

* test: run bit-exact reference tests only on reference hardware (#174)

* style: format DiffusionGemmaVisionOracleTests.swift

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style: format DiffusionGemmaFactoryTests.swift

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: run bit-exact reference tests only on reference hardware

Nine DiffusionGemma tests compare float bits with frozen references.
On the hosted macos-26 runner (Apple M1 VM) they differ in the low bits,
with no change in shape, dtype or sign. Add a `.referenceHardware`
Swift Testing trait that runs a test only when MLX_REFERENCE_HARDWARE=1,
and mark the nine tests with it. Elsewhere they report as skipped with
the reason. No assertion, tolerance or reference changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: gate only the bit comparisons of mixed DiffusionGemma tests

Three gated tests also held checks that pass on any hardware. Split them
so only the bit-for-bit comparison is gated:

- prefixIdentityTokensOwnerAndEmptyStateFailClosed() runs its
  fail-closed probes on all hardware. The donor-logits bit comparison
  moves to failClosedProbesLeaveDonorLogitsBitExact().
- nativeFactoryLoadsExactStateAndReleasesItsModel() keeps the load and
  model-release checks on all hardware. The logits bit comparison moves
  to nativeFactoryDenoiseMatchesReferenceBits().
- The two parameterized vision tests run their bf16 case on all
  hardware. The fp32 case moves to a separate gated test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: gate only the reference comparisons of three more DiffusionGemma tests

Split the three tests that were still gated whole, so their checks that
pass on any hardware run everywhere:

- chunkedSessionBoundsPrefillAndCanCancelAfterPrefill() keeps the
  prefill bounds, the complete flag, the counters, cancel, the emitted
  checkpoint and the released cache for widths 1, 3 and 7. The KV and
  logits bit comparisons move to chunkedSessionMatchesIndependentNativeReference().
- sharedWeightsConditioningKeepsCommittedCacheState() keeps the fixture
  checks, both cache positions and the unchanged encoder KV after the
  provisional canvas. The reference comparisons stay in
  sharedWeightsConditioningAndCommittedCacheMatchReference().
- committedPrefixRestoreKeepsPositionsAfterDonorRetirement() keeps the
  token count, retained bytes, donor release and both positions. The
  reference comparisons stay in
  committedPrefixRestoreIsExactAfterDonorAppendAndRetirement().

Each pair shares one helper. The fixture reference, case-count and
parameter-count checks of the block and fp32 vision fixtures also run
everywhere now, in blockOracleFixtureIsPinned() and fp32FixtureIsPinned().
CONTRIBUTING.md says which comparisons the gate covers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit a046367)

* docs: describe demanded checkpoints and their shared fixture

* fix(cache): honor request participation in short checkpoint scheduling

* Preserve demanded checkpoint eligibility through preemption and packing

* test: size the slot-cap request from what the ledger accepts

slotCapLeavesRoomForServing() sized its request from bytesReserved.
bytesReserved includes the paged pool's physical-floor overhead, which a
request's target KV replaces when it reserves. The overhead depends on
the buffer sizes the MLX allocator returns: a 36,864-byte segment gets a
49,152-byte buffer, or a 65,536-byte buffer reused from the process-wide
cache. When earlier work left 64 KiB buffers in the cache, the capped
arm left more than 5.5 windows of real slack instead of half a window,
and the uncapped arm's reservation fit.

Find the largest request the ledger accepts beside the capped set with
trial reservations, then take half a window off it. The assertions do
not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 06224a8)

* Retain demanded native frontiers and preserve observed prefill endpoints

* Document current SDK parameters and generation links

* Disambiguate the task generation documentation link

---------

Co-authored-by: David Tai <dtaipublic@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
javiech1 pushed a commit to javiech1/mlx-swift-lm that referenced this pull request Oct 24, 2026
* support for audio resources

- see Layr-Labs#192, Layr-Labs#194
- this adds representation of audio in UserInput and LMInput
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants